//
//  HLImageStatusView.m
//  YueYue
//
//  Created by hulu001 on 2023/5/18.
//

#import "HLImageStatusView.h"

@implementation HLImageStatusView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
    }
    return self;
}

- (void)setupView
{
    self.imageView = [[UIImageView alloc] init];
    _imageView.contentMode = UIViewContentModeScaleAspectFill;
    _imageView.layer.masksToBounds = YES;
    _imageView.layer.cornerRadius = 4;
    [self addSubview:_imageView];
    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    self.playVideoView = [[UIImageView alloc] init];
    _playVideoView.image = UIImageMake(@"video_play_icon");
    _playVideoView.hidden = YES;
    [self addSubview:_playVideoView];
    [_playVideoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(0);
    }];
    
    self.previewButton = [[UIButton alloc] init];
    [self addSubview:_previewButton];
    [_previewButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.mas_equalTo(0);
        make.top.mas_equalTo(10);
        make.right.mas_equalTo(-10);
    }];
    
    self.statusLabel = [[QMUILabel alloc] init];
    _statusLabel.font = UIFontMake(10);
    _statusLabel.textColor = UIColorWhite;
    _statusLabel.text = @"审核中";
    _statusLabel.contentEdgeInsets = UIEdgeInsetsMake(2, 2, 2, 2);
    _statusLabel.backgroundColor = HLAideColor2;
    _statusLabel.layer.masksToBounds = YES;
    _statusLabel.layer.cornerRadius = 2;
    _statusLabel.hidden = YES;
    [self addSubview:_statusLabel];
    [_statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(4);
        make.right.mas_equalTo(-4);
    }];
    
    self.closeButton = [[QMUIButton alloc] init];
    [_closeButton setImage:UIImageMake(@"opus_image_close") forState:UIControlStateNormal];
    [_closeButton setBackgroundColor:[UIColor qmui_colorWithHexString:@"#FF1350"]];
    [_closeButton setCornerRadius:8];
    _closeButton.hidden = NO;
    [self addSubview:_closeButton];
    [_closeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(16);
        make.top.mas_equalTo(4);
        make.right.mas_equalTo(-4);
    }];
}


@end
